package com.xjscrm.common.spring.config;

import com.xjscrm.common.spring.exception.GlobalExceptionHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Auther: jianghan
 * @Date: 2021/8/12 12:38
 * @Description:
 */
@Component
@Configuration
public class GlobalExceptionConfig {

    @Bean("globalExceptionHandler")
    @ConditionalOnMissingBean
    public GlobalExceptionHandler globalExceptionHandler(){
        return new GlobalExceptionHandler();
    }
}
